package com.ztgf.commodity.mapper;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.ztgf.commodity.models.bo.*;
import com.ztgf.commodity.models.dto.CommodityInfoDTO;
import com.ztgf.commodity.models.vo.*;
import com.ztgf.sys.models.dto.SysAreaDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * author: chenyu.wang
 * date: 2020-05-25 14:50
 * Description: 商品info
 */
@Mapper
public interface CommodityInfoMapper extends BaseMapper<CommodityInfoDTO> {

    List<CommodityInfoHotSellVO> getHotSellListById(Long shopId);

    /**
     * description: 卖家端产品管理全部产品列表
     * param: [pages, vo]
     * author: chenyu.wang
     * date: 2020-05-27
     * return: java.util.List<com.ztgf.commodity.models.vo.CommoditySellerVO>
     */
    List<CommoditySellerVO> querySellerPageList(Page<CommoditySellerVO> pages, @Param("item") CommoditySellerVO vo);

    /**
     * description: 卖家个人中心产品管理审核中的商品列表
     * param: [pages, vo]
     * author: chenyu.wang
     * date: 2020-05-27
     * return: java.util.List<com.ztgf.commodity.models.vo.CommoditySellerVO>
     */
    List<CommoditySellerVO> querySellerReviewList(Page<CommoditySellerVO> pages, @Param("item") CommoditySellerVO vo);

    /**
     * description: 卖家个人中心未上架产品列表
     * param: [pages, vo]
     * author: chenyu.wang
     * date: 2020-06-09
     * return: java.util.List<com.ztgf.commodity.models.vo.CommoditySellerVO>
     */
    List<CommoditySellerVO> querySellerNotOnGoodsList(Page<CommoditySellerVO> pages, @Param("item") CommoditySellerVO vo);

    /**
     * description: 卖家个人中心上架中的产品列表
     * param: [pages, bo]
     * author: chenyu.wang
     * date: 2020-06-09
     * return: java.util.List<com.ztgf.commodity.models.vo.CommodityInPutawayVO>
     */
    List<CommodityInPutawayVO> querySellerInPutawayList(Page<CommodityInPutawayVO> pages, @Param("item") CommodityInPutawayBO bo);

    /**
     * description: 卖家个人中心库存管理列表
     * param: [pages, bo]
     * author: chenyu.wang
     * date: 2020-06-09
     * return: java.util.List<com.ztgf.commodity.models.vo.CommodityInventoryVO>
     */
    List<CommodityInventoryVO> querySellerInventoryList(Page<CommodityInventoryVO> pages, @Param("item") CommodityInventoryBO bo);

    /**
     * description: 统计单个商品销量
     * param: [id]
     * author: chenyu.wang
     * date: 2020-06-09
     * return: java.lang.Integer
     */
    Integer getOneGoodsTotalSales(@Param("id") Long id);

    /**
     * description: 根据id商品价格，用于其它接口调用
     * param: [id]
     * author: chenyu.wang
     * date: 2020-06-03
     * return: com.ztgf.commodity.models.vo.CommodityPriceVO
     */
    CommodityPriceVO getByIdOtherInterface(@Param("id") Long id);

    /**
     * description: 商城商品基础详细信息
     * param: [id]
     * author: chenyu.wang
     * date: 2020-06-05
     * return: com.ztgf.commodity.models.vo.CommodityDetailsVO
     */
    CommodityDetailsVO getCommodityDetails(@Param("id") Long id);

    /**
     * description: 商城商品价格信息
     * param: [id]
     * author: chenyu.wang
     * date: 2020-06-05
     * return: java.util.List<com.ztgf.commodity.models.vo.CommodityAttrPriceVO>
     */
    CommodityAttrPriceVO getCommodityAttrPrice(@Param("goodsId") Long goodsId);

    /**
     * description: 统计销量人气，用于商品详情页，参数为商品id
     * param: [goodsId]
     * author: chenyu.wang
     * date: 2020-06-05
     * return: java.lang.Integer
     */
    Integer getCountSales(@Param("goodsId") Long goodsId,@Param("shopId")Long shopId);

    /**
     * description: 商城商品详情页，同类商品推荐
     * param: [id] 分类id
     * author: chenyu.wang
     * date: 2020-06-05
     * return: java.util.List<com.ztgf.commodity.models.vo.CommoditySimilarVO>
     */
    List<CommoditySimilarVO> getSimilarCommodity(@Param("id") Long id);

    /**
     * description: 根据ids查询商品
     *
     * @param list
     * @return
     */
    List<CommodityInfoDTO> queryByIds(List<String> list);

    /**
     * description: 查询卖家个人中心商品回收站列表
     * param: [page, bo]
     * author: chenyu.wang
     * date: 2020-06-10
     * return: java.util.List<com.ztgf.commodity.models.vo.CommodityRecycleBinVO>
     */
    List<CommodityRecycleBinVO> querySellerRecycleBinList(Page<CommodityRecycleBinVO> page, @Param("item") CommodityRecycleBinBO bo);

    /**
     * description: 根据商品id，查询商品套餐情况
     * param: [goodsId]
     * author: chenyu.wang
     * date: 2020-06-15
     * return: java.util.List<com.ztgf.commodity.models.vo.CommodityComboRelationVO>
     */
    List<CommodityComboRelationVO> queryGoodsComboMsg(@Param("goodsId") Long goodsId);

    /**
     * description: 后台管理系统产品列表
     * param: [page, bo]
     * author: chenyu.wang
     * date: 2020-07-01
     * return: java.util.List<com.ztgf.commodity.models.vo.CommodityAdminListVO>
     */
    List<CommodityAdminListVO> queryAdminPageList(Page<CommodityAdminListVO> page, @Param("item") CommodityAdminListBO bo);


    /**
     * description: 查看产品详情
     * param: [id]
     * author: chenyu.wang
     * date: 2020-07-02
     * return: com.ztgf.commodity.models.vo.CommodityRegardVO
     */
    CommodityRegardVO queryCenterGoodsDetails(@Param("id") Long id);

    /**
     * description: 根据商品id查询规格属性
     * param: [goodsId]
     * author: chenyu.wang
     * date: 2020-07-02
     * return: java.util.List<com.ztgf.commodity.models.vo.CommodityRegardAttrVO>
     */
    List<CommodityRegardAttrVO> getAttrByGoodsId(@Param("goodsId") Long goodsId);

    /**
     * description: 根据商品id查询套餐信息
     * param: [goodsId]
     * author: chenyu.wang
     * date: 2020-07-02
     * return: java.util.List<com.ztgf.commodity.models.vo.CommodityRegardAttrVO>
     */
    List<CommodityRegardAttrVO> getComboByGoodsId(@Param("goodsId") Long goodsId);

    /**
     * description: 根据商品id获取商品参数信息详情
     * param: [goodsId]
     * author: chenyu.wang
     * date: 2020-07-02
     * return: java.util.List<com.ztgf.commodity.models.vo.CommodityParamValueRelationVO>
     */
    List<CommodityParamValueRelationVO> queryGoodsParamDetails(@Param("goodsId") Long goodsId);

    List<CommodityInfoRankVO> getCommoditySalesRank(@Param("shopId") Long shopId);

    /**
     * description: 后台管理系统产品审核列表
     * param: [page, bo]
     * author: chenyu.wang
     * date: 2020-07-13
     * return: java.util.List<com.ztgf.commodity.models.vo.CommodityAuditVO>
     */
    List<CommodityAuditVO> queryAuditAdminList(Page<CommodityAuditVO> page, @Param("item") CommodityAuditBO bo);

    /**
     * description: 查询店铺下商品，用于商城店铺装修页
     * param: [bo]
     * author: chenyu.wang
     * date: 2020-07-17
     * return: java.util.List<com.ztgf.commodity.models.vo.CommodityDecorationVO>
     */
    List<CommodityDecorationVO> queryShopCommodityList(@Param("item") CommodityDecorationBO bo, @Param("ids") List<Long> ids);

    /**
     * description: 查询商城店铺所有商品
     * param: [page]
     * author: chenyu.wang
     * date: 2020-07-23
     * return: java.util.List<com.ztgf.commodity.models.vo.CommodityDecorationVO>
     */
    List<CommodityDecorationVO> queryShopAllCommodityList(Page<CommodityDecorationVO> page, @Param("item") CommodityShopAllListBO bo);

    /**
     * description: 后台管理系统店铺所有产品列表
     * param: [page, bo]
     * author: chenyu.wang
     * date: 2020-07-27
     * return: java.util.List<com.ztgf.commodity.models.vo.CommodityAdminShopListVO>
     */
    List<CommodityAdminShopListVO> queryAdminShopCommodityList(Page<CommodityAdminShopListVO> page, @Param("item") CommodityAdminShopListBO bo);

    /**
     * description: 查询所有上架中的产品，用于平台频道装修页
     * param: [bo]
     * author: chenyu.wang
     * date: 2020-07-30
     * return: java.util.List<com.ztgf.commodity.models.vo.CommodityDecorationVO>
     */
    List<CommodityDecorationVO> queryDecorationCommodityList(@Param("item") CommodityDecorationBO bo);

    /**
     * description: 根据区域id，查询区域信息
     * param: [id]
     * author: chenyu.wang
     * date: 2020-08-04
     * return: com.ztgf.sys.models.dto.SysAreaDTO
     */
    SysAreaDTO queryAreaInformation(@Param("id") Long id);

    /*
     * @description:获取商品信息，用于es
     * @author: chenyu.wang
     * @date: 2020-08-26
     */
    List<CommodityEsVO> queryESGoods();

    /*
     * @description:最新获取商品信息，用于es
     * @author: chenyu.wang
     * @date: 2020-08-26
     */
    List<CommodityEsVO> queryAllESGoods(@Param("offset") long offset);

    /*
     * @description:最新获取商品信息，用于es
     * @author: chenyu.wang
     * @date: 2020-08-26
     */
    List<CommodityEsVO> queryAllESGoodsByCommodityId(@Param("id") long id);


    /*
     * @description:最新获取商品数量，用于es
     * @author: chenyu.wang
     * @date: 2020-08-26
     */
    int queryAllESGoodsCount();



    /*
     * @description:根据商品ids查询，用于商品导出
     * @author: chenyu.wang
     * @date: 2020-08-31
     */
    CommodityExportVO queryGoodsByIds(@Param("id") Long id);

    /*
     * @description:查询后台需要导出的商品信息
     * @author: chenyu.wang
     * @date: 2020-09-16
     * @return:
     */
    CommodityAdminExportVO queryAdminExportGoods(@Param(value = "goodsId") Long goodsId);

    /**
     * @Description: 后台管理系统产品回收站
     * @Author: WangChenYu
     * @Param: [page]
     * @Date: 2020-10-10 10:39
     */
    List<CommodityAdminListVO> queryAdminGoodsRecycleBin(Page<CommodityAdminListVO> page, @Param(value = "item") CommodityAdminListBO bo);

    /**
     * @Description: 后台管理系统代客下单商品列表
     * @Author: WangChenYu
     * @Param: [page, bo]
     * @Date: 2020-10-12 11:57
     */
    List<CommodityAdminListVO> queryAdminValetOrderGoodsList(Page<CommodityAdminListVO> page, @Param("item") CommodityAdminListBO bo);

    /**
     * @Description: 获取商品规格最高最低价格
     * @Author: chenyu.wang
     * @Params: [goodsId]
     * @Date: 2020.11.17 10:41
     */
    CommodityPriceCheckVO getGoodsPrice(@Param(value = "goodsId") Long goodsId);

    /**
     * @Description: 获取商品套餐最高最低价格
     * @Author: chenyu.wang
     * @Params: [goodsId]
     * @Date: 2020.11.17 10:41
     */
    CommodityPriceCheckVO getGoodsComboPrice(@Param(value = "goodsId") Long goodsId);

    /**
     * @Description: 根据Id查询要添加的es商品
     * @Author: chenyu.wang
     * @Params: [goodsId]
     * @Date: 2020.11.18 11:52
     */
    CommodityEsVO queryESGoodsById(@Param(value = "goodsId") Long goodsId);

    /**
     * @return : java.util.List<com.ztgf.commodity.models.vo.GoodsExportVO>
     * @Author :chenyu.wang
     * @Description : 获取卖家端导出商品的规格信息
     * @Date : 2021.03.03 11:17
     * @Param : [goodsId]
     **/
    List<GoodsExportVO> getSku(@Param("goodsId") Long goodsId);

    /**
     * @return : java.util.List<com.ztgf.commodity.models.vo.GoodsExportVO>
     * @Author :chenyu.wang
     * @Description : 获取卖家端导出商品的套餐信息
     * @Date : 2021.03.03 11:17
     * @Param : [goodsId]
     **/
    List<GoodsExportVO> getSkuA(@Param("goodsId") Long goodsId);


    List<CommodityExportNewVO> queryExportList(CommodityAdminListBO bo);

    /**
     * admin 下架店铺商品
     * @param shopId
     * @return
     */
    Integer updateNoPublishByShopIdAdmin(@Param("shopId") Long shopId, @Param("notes") String notes);

    /**
     * admin 下架店铺商品
     * @param shopId
     * @return
     */
    List<Long> queryListByShopId(@Param("shopId") Long shopId);

    Integer queryPayUserNum(@Param("id") Long id);

    Integer getPublishCount(@Param("publishStatus") Integer publishStatus);
}
